<template>
	<el-container style="height: 480px">
		<el-header>
			<el-form
				inline
				label-width="49px"
				:model="queryList"
				style="margin-top: 5px"
			>
				<el-row :gutter="5"
					><el-col :span="10">
						<sc-org-select
							ref="orgselect"
							:props="props"
							:pageId="'orgGoodsType'"
							:userCode="
								this.$TOOL.data.get('USER_INFO').userCode
							"
							:selectKeyValue="'OrgCode'"
							v-model="queryList.OrgCodeList"
							@fatherMethod="orgSelectProcess"
						>
						</sc-org-select></el-col
					><el-col :span="4">
						<el-input
							v-model="queryList.Code"
							placeholder="请输入员工编码"
							style="width: 125px"
						></el-input>
					</el-col>
					<el-col :span="4">
						<el-input
							v-model="queryList.Name"
							placeholder="请输入员工姓名"
							style="width: 125px"
						></el-input>
					</el-col>
					<el-col :span="4">
						<el-input
							v-model="queryList.Mobile"
							placeholder="请输入手机号"
							style="width: 125px"
						></el-input>
					</el-col>
					<el-col :span="2">
						<el-button
							type="primary"
							@click="opBindData()"
							>查询</el-button
						></el-col
					></el-row
				>
			</el-form>
		</el-header>
		<el-foot>
			<scTable
				ref="mytable"
				:data="listData"
				:attrList="attrList"
				:valueList="valueList"
				:queryList="queryList"
				:sort-orders="['ascending', 'descending']"
				@selection-change="selectionChange"
				row-key="Code"
				key="Code"
				stripe
				:hideDo="true"
				style="max-height: 380px; min-width: 420"
			>
				<el-table-column type="selection" width="50"></el-table-column>
				<el-table-column
					type="index"
					label="序号"
					prop="rownumber"
					width="50"
				></el-table-column>
				<el-table-column
					label="机构"
					prop="OrgName"
					width="180"
					sortable
				></el-table-column>
				<el-table-column
					label="编码"
					prop="UserCode"
					width="100"
					sortable
				></el-table-column>
				<el-table-column
					label="姓名"
					prop="UserName"
					width="120"
					sortable
				></el-table-column>
				<el-table-column
					label="性别"
					prop="SexName"
					width="100"
					sortable
				></el-table-column>
				<el-table-column
					label="手机"
					prop="Mobile"
					width="150"
					sortable
				></el-table-column> </scTable
		></el-foot>
	</el-container>
</template>

<script>
import publicjs from "@/api/model/publicjs";
export default {
	name: "typelist",
	components: {
		publicjs,
	},
	data() {
		return {
			selectionRows: [],
			pkList: ["Code"],
			attrList: {
				Name: "UserInfo",
				UseDistinct: false,
				OrgCode: "",
				UseBackUp: false,
				UseGroup: false,
			},
			valueList: {
				Code: "UserCode",
				Name: "UserName",
				OrgCode: "OrgCode",
				OrgName: "OrgName",
				SexName: "SexName",
				Mobile: "Mobile",
			},
			queryList: {
				OrgCode: "",
				OrgCodeList: [],
				Code: "",
				Name: "",
				SexCode: "",
				Mobile: "",
				InLocal: "0",
			},
			result: "", // 运行结果
			props1: {
				checkStrictly: true,
				emitPath: false,
			},
			props: {
				label: "OrgName",
				value: "OrgCode",
			},
			orgCodeList: "",
			orgNameList: "",
		};
	},
	methods: {
		//表格选择后回调事件
		selectionChange(selection) {
			// eslint-disable-next-line no-debugger
			//debugger;
			this.selectionRows = selection;
		},

		async opBindData() {
			this.$refs.mytable.clearSort();
			this.$refs.mytable.getData();
		},
	},
	mounted() {
		this.$refs.mytable.getData();
	},
};
</script>
